This invention generally relates to the display of parametric surfaces in a computer graphics system. In particular, a trimming operation is implemented wherein a portion of a surface, displayed on a computer graphics system, is subtracted. For example, a scene being displayed may include a sphere, a cylinder, a planar surface and the intersection therebetween. It may be desired to subtract the sphere (or a portion of the sphere) from the scene, such that a shadow, shaded area, or the like may be displayed in place of the sphere.
Generally, non-trimmed parametric surfaces may be rendered on graphics hardware by computing and shading a tessellation area (generally a triangulation) covering the entire surface to be displayed. It should be noted that a triangulated surface shall be used herein to describe any area to be rendered on the display of the computer graphics system. Trimmed surfaces are limited by the intersection of trimming curves therewith, which function to subtract an area, or portion of the surface, for reasons discussed above.
Traditional methods for rendering trimmed surfaces include modifying the tessellation of a surface by introducing surface points along the trimming curves at the point(s) of intersection of the border of the original tessellation triangle. Prior art systems then must compute coordinates, normals and reflected light intensities for each of these additional points. PG,3 Additionally, since the majority of graphics processing systems are optimized for triangles, the relevant portions of the tessellation triangles, near the trimming curve, must be triangulated (FIG. 3). The introduction of these new points results in shading inconsistencies between points on the trimmed surface and the same points on the original non-trimmed surface. Further, processing time is increased for the trimmed surfaces since the coordinates, normals, light intensities and triangulation must occur.
Other conventional systems include using the software of the graphics system to perform trimming, prior to sending the device coordinates to the display hardware, which is a complex and slow solution, that requires a large amount of program memory.
European Patent 0 277 832 performs trimming by using a graphics accelerator which determines where straight line approximating segments of the trimming curves cross subspan boundaries of the tessellated area and changes the vertices of the subspans to trim away portions of the polygon. A data structure is built linking lists of vertex tables that represent the untrimmed polygon and any trimming curves which intersect the polygon.
U.S. Pat. No. 4,914,607 describes a multi-window environment in which the data to be displayed undergoes an exclusive OR operation, bit by bit, with the bit-map data developed in a logical plane.
It can be seen that conventional trimming systems are extremely complex and require a great deal of computing time and overhead. Therefore, it is desirable to have a computer graphics system which is capable of performing a trimming operation that overcomes the drawbacks of prior art systems. In particular a trimming system is desired which: (1) does not require lighting calculations for additional vertices (points) along the trimming curve; (2) avoids triangulation of portions of tessellated triangles near the trimming curve; and (3) provides consistent shading between trimmed and non-trimmed surfaces, i.e. the colors resulting from lighting calculations on a trimmed surface should be identical to the colors resulting from lighting calculations on an identical surface which is not trimmed, for all areas common to both rendered surfaces.